package com.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the REPRO database table.
 * 
 */
@Entity
@NamedQuery(name="Repro.findAll", query="SELECT r FROM Repro r")
public class Repro implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="REPRO_RETID_GENERATOR", sequenceName="SEQ",initialValue=1,allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="REPRO_RETID_GENERATOR")
	@Column(name="RET_ID")
	private long retId;

	@Column(name="RET_CHARGE")
	private String retCharge;

	@Temporal(TemporalType.DATE)
	@Column(name="RET_DATE")
	private Date retDate;

	@Column(name="RET_DEPOT")
	private String retDepot;

	@Column(name="RET_MONEY")
	private BigDecimal retMoney;

	@Column(name="RET_NUM")
	private String retNum;

	//bi-directional many-to-one association to Payrecord
	@OneToMany(cascade={CascadeType.REMOVE},mappedBy="repro")
	@JSONField(serialize=false)
	private List<Payrecord> payrecords;

	//bi-directional many-to-one association to Order
	@ManyToOne
	@JoinColumn(name="OR_ID")
	private Order order;

	//bi-directional many-to-one association to Returndetail
	@OneToMany(cascade={CascadeType.REMOVE},mappedBy="repro")
	@JSONField(serialize=false)
	private List<Returndetail> returndetails;

	@Column(name="RET_NAME")
	private String retName;
	
	
	
	public String getRetName() {
		return retName;
	}

	public void setRetName(String retName) {
		this.retName = retName;
	}

	public Repro() {
	}

	public long getRetId() {
		return this.retId;
	}

	public void setRetId(long retId) {
		this.retId = retId;
	}

	public String getRetCharge() {
		return this.retCharge;
	}

	public void setRetCharge(String retCharge) {
		this.retCharge = retCharge;
	}

	public Date getRetDate() {
		return this.retDate;
	}

	public void setRetDate(Date retDate) {
		this.retDate = retDate;
	}

	public String getRetDepot() {
		return this.retDepot;
	}

	public void setRetDepot(String retDepot) {
		this.retDepot = retDepot;
	}

	public BigDecimal getRetMoney() {
		return this.retMoney;
	}

	public void setRetMoney(BigDecimal retMoney) {
		this.retMoney = retMoney;
	}

	public String getRetNum() {
		return this.retNum;
	}

	public void setRetNum(String retNum) {
		this.retNum = retNum;
	}

	public List<Payrecord> getPayrecords() {
		return this.payrecords;
	}

	public void setPayrecords(List<Payrecord> payrecords) {
		this.payrecords = payrecords;
	}

	public Payrecord addPayrecord(Payrecord payrecord) {
		getPayrecords().add(payrecord);
		payrecord.setRepro(this);

		return payrecord;
	}

	public Payrecord removePayrecord(Payrecord payrecord) {
		getPayrecords().remove(payrecord);
		payrecord.setRepro(null);

		return payrecord;
	}

	public Order getOrder() {
		return this.order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public List<Returndetail> getReturndetails() {
		return this.returndetails;
	}

	public void setReturndetails(List<Returndetail> returndetails) {
		this.returndetails = returndetails;
	}

	public Returndetail addReturndetail(Returndetail returndetail) {
		getReturndetails().add(returndetail);
		returndetail.setRepro(this);

		return returndetail;
	}

	public Returndetail removeReturndetail(Returndetail returndetail) {
		getReturndetails().remove(returndetail);
		returndetail.setRepro(null);

		return returndetail;
	}

}